package com.lujianfei.virusbroadcast.utils;

import java.util.HashMap;
import java.util.Map;

public class LogCount {

	Map<String,Long> map  = new HashMap<String, Long>();
	
	public void start(String tag) {
		map.put(tag, System.currentTimeMillis());
	}
	
	public void end(String tag) {
		boolean containsKey = map.containsKey(tag);
		if (containsKey) {
			Long time = map.get(tag);
			System.out.println(String.format("%s cost %s ms", tag,time));
		}
	}
}
